package com.zjdt.project.mysystem.service.impl;

import java.util.List;
import com.zjdt.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zjdt.project.mysystem.mapper.FlushScreenMapper;
import com.zjdt.project.mysystem.domain.FlushScreen;
import com.zjdt.project.mysystem.service.IFlushScreenService;

/**
 * 闪屏图片Service业务层处理
 * 
 * @author dusin
 * @date 2024-07-26
 */
@Service
public class FlushScreenServiceImpl implements IFlushScreenService 
{
    @Autowired
    private FlushScreenMapper flushScreenMapper;

    /**
     * 查询闪屏图片
     * 
     * @param flushScreenId 闪屏图片主键
     * @return 闪屏图片
     */
    @Override
    public FlushScreen selectFlushScreenByFlushScreenId(Long flushScreenId)
    {
        return flushScreenMapper.selectFlushScreenByFlushScreenId(flushScreenId);
    }

    /**
     * 查询闪屏图片列表
     * 
     * @param flushScreen 闪屏图片
     * @return 闪屏图片
     */
    @Override
    public List<FlushScreen> selectFlushScreenList(FlushScreen flushScreen)
    {
        return flushScreenMapper.selectFlushScreenList(flushScreen);
    }

    /**
     * 新增闪屏图片
     * 
     * @param flushScreen 闪屏图片
     * @return 结果
     */
    @Override
    public int insertFlushScreen(FlushScreen flushScreen)
    {
        flushScreen.setCreateTime(DateUtils.getNowDate());
        return flushScreenMapper.insertFlushScreen(flushScreen);
    }

    /**
     * 修改闪屏图片
     * 
     * @param flushScreen 闪屏图片
     * @return 结果
     */
    @Override
    public int updateFlushScreen(FlushScreen flushScreen)
    {
        flushScreen.setUpdateTime(DateUtils.getNowDate());
        return flushScreenMapper.updateFlushScreen(flushScreen);
    }

    public int updateStatus(FlushScreen flushScreen)
    {
        return flushScreenMapper.updateFlushScreen(flushScreen);
    }

    /**
     * 批量删除闪屏图片
     * 
     * @param flushScreenIds 需要删除的闪屏图片主键
     * @return 结果
     */
    @Override
    public int deleteFlushScreenByFlushScreenIds(Long[] flushScreenIds)
    {
        return flushScreenMapper.deleteFlushScreenByFlushScreenIds(flushScreenIds);
    }

    /**
     * 删除闪屏图片信息
     * 
     * @param flushScreenId 闪屏图片主键
     * @return 结果
     */
    @Override
    public int deleteFlushScreenByFlushScreenId(Long flushScreenId)
    {
        return flushScreenMapper.deleteFlushScreenByFlushScreenId(flushScreenId);
    }


}
